package demoxsgl_300.com.gouwu1500.zhi;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.widget.ImageView;
import android.widget.Toast;

import com.bumptech.glide.Glide;

import butterknife.BindView;
import butterknife.ButterKnife;
import demoxsgl_300.com.gouwu1500.R;
import demoxsgl_300.com.gouwu1500.http.API;
import demoxsgl_300.com.gouwu1500.http.Okhttp;

public class FenXiActivity extends Activity {

    @BindView(R.id.imageView6)
    ImageView imageView6;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_fen_xi);
        ButterKnife.bind(this);
        Glide.with(FenXiActivity.this).load(R.drawable.loading).asGif().into(imageView6);

        String ZOng = Content.FaZuoTeDian + Content.BingZhengXingZhi + Content.YouYin + Content.BanSui;
        Content.Zong = ZOng;
        API.zhen(Content.ZhuSu, Content.SheTou, ZOng, new Okhttp.Objectcallback() {
            @Override
            public void onsuccess(String st) {
                Log.e("1111", "xx" + st);
                startActivity(new Intent(FenXiActivity.this,
                        JieGuoFenXiActivity.class).putExtra("fenxi", st));
                finish();
            }

            @Override
            public void onFalia(int code, String errst) {
                Log.e("1111", "xx:" + errst);
                Toast.makeText(FenXiActivity.this, "网络错误！", Toast.LENGTH_SHORT).show();
                finish();
                startActivity(new Intent(FenXiActivity.this, JieGuoFenXiActivity.class));
            }
        });
    }
}
